﻿using System;
using ORS.OrderRobot.ServiceContracts.Dtos;

namespace ORS.OrderRobot.ServiceContracts
{
	public interface IHttpHelper
	{
        /// <summary>
        /// 发送请求
        /// </summary>
        /// <param name="url"></param>
        /// <param name="method"></param>
        /// <param name="requestInfo"></param>
        /// <returns></returns>
        Task<ResponseInfo<string>> SendAsync(string url,HttpMethod method, RequestInfo? requestInfo = null);
        /// <summary>
        /// 发送数据请求，并将内容序列化为T
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="url"></param>
        /// <param name="method"></param>
        /// <param name="requestInfo"></param>
        /// <returns></returns>
        Task<ResponseInfo<T>> SendAndParseAsync<T>(string url,HttpMethod method,RequestInfo? requestInfo = null);
    }
}

